import logging,HTMLTestRunner_cn,yagmail,time,pytest
import os.path
import time

class Tools():
    #日志
    def Log1(self):
        log1 = logging.basicConfig(level=logging.DEBUG,format='%(levelname)s %(message)s %(asctime)s %(filename)s %(lineno)d ')
    #报告
    def Report(self):
        report1 = HTMLTestRunner_cn.HTMLTestRunner(open('./jiuxian.html','wd'),title='jiuxian登录搜索测试报告',description='jiuxian项目实现数据驱动，测试结果，生成测试报告')
        return report1

    #邮件
    def Email(self):
        email = yagmail.SMTP(user='3484055372@qq.com',password='ufxzgmbqqnyhciji',host='smtp.qq.com',port=456)
        email.send(to='3484055372@qq.com',subject='酒仙网版本测试',contents=['执行了3条用例，均通过测试','./酒仙网.log'])
        email.close()

if __name__ == '__main__':
    pytest.main([r"E:\zhuangao\weekk2\conftest.py",'-s','--html=酒仙网.html'])